<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf8" %> 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<%@ page language="java" import="java.sql.*"%>  
<%@ page language="java" import="java.io.*" %>  
<html>
<head></head>
<body>
  <%  
         String aid = request.getParameter("id");
         String DRIVER = "com.mysql.jdbc.Driver";  
         String url = "jdbc:mysql://localhost:3306/myblogdb";  
 
         Connection con = null;  
         ResultSet rst = null;  
         Statement stmt = null;  
                
         int i = 1;  
    
         try {  
               Class.forName(DRIVER).newInstance();  
                 
               con = DriverManager.getConnection(url, "root", "851222");  
               stmt = con.createStatement();  
               rst = stmt.executeQuery("select title,content from article where id="+aid);  
               while (rst.next()) {  
		  String tit = rst.getString(1);
		  String content = rst.getString(2);
          %>  

<div style="padding:5px;font-size:14px;"><%=content%></div>
<%
		}
  	       rst.close();  
  	       stmt.close();  
    	       con.close();  
             } catch (Exception e) {  
                 System.out.println(e.getMessage());  
               }  
%>
</body>
</html>
